<?php
include("functions.php");
include("libs/smarty.class.php");
$smarty = new Smarty();
$title = "Strona główna";
$smarty->assign("title",$title);

$announcements = getAnnouncements();


if(!empty($_GET)){
    if(!empty($_GET['error'])){
        $i = $_GET['error'];
        $info_action = displayInfo($i, 'red');
    }
    else{
        $i = $_GET['info'];
        $info_action = displayInfo($i, 'green');
    }
    $smarty->assign("info_action",$info_action);
}
$smarty->assign("announcements",$announcements);
$smarty->display('index.tpl');
?>